load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "permission_checker",
    srcs = glob(["src/**/*.rs"]),
    test_deps = [
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
    ] + ([] if rust_oss.is_oss_build() else [
        "fbsource//third-party/rust:percent-encoding",
    ]),
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:openssl",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
        "//common/rust/aclchecker:aclchecker",
        "//common/rust/identity:identity_ext",
        "//common/rust/shed/fbinit:fbinit",
    ] + ([] if rust_oss.is_oss_build() else [
        "//access/if:authenticated_identity_thrift-rust",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//configerator/structs/infrasec/if:acl-rust",
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:tokio",
        "//configerator/structs/infrasec/if:acl-rust",
        "//infrasec/authorization/if:if-service-rust",
        "//infrasec/authorization/if:if-service-rust-srclients",
    ]),
)
